package com.developer.platform.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.developer.platform.infrastructure.enums.SexEnum;
import com.developer.platform.infrastructure.enums.StatusEnum;
import com.veeker.mybatis.basic.BaseEntity;

/**
 * @author ：qiaoliang
 * @date ：2020-10-16
 */
@TableName(value = "sys_user",autoResultMap = true)
public class User extends BaseEntity<Long,Long> {
    /**部门ID**/
    private long deptId;
    /**用户名**/
    private String username;
    /**密码**/
    private String password;
    /**昵称**/
    private String name;
    /**email**/
    private String email;
    /**手机号**/
    private String phone;
    /**性别**/
    private SexEnum sex;
    /**头像**/
    private String avatar;
    /**启用**/
    private StatusEnum status;


    public void updateStatus(){
        this.setStatus(StatusEnum.Y.equals(this.getStatus())?StatusEnum.N:StatusEnum.Y);
    }

    public User() {
    }

    public User(Long id) {
        super(id);
    }

    public User(String username, String password, String name, String avatar, String phone) {
        this.username = username;
        this.password = password;
        this.name = name;
        this.avatar = avatar;
        this.phone = phone;
        this.sex = SexEnum.S;
    }

    public long getDeptId() {
        return deptId;
    }

    public void setDeptId(long deptId) {
        this.deptId = deptId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }


    public SexEnum getSex() {
        return sex;
    }

    public void setSex(SexEnum sex) {
        this.sex = sex;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public StatusEnum getStatus() {
        return status;
    }

    public void setStatus(StatusEnum status) {
        this.status = status;
    }
}
